#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
int tree[N];
int n, m;
int lowbit(int x)
{
	return x & -x;
}

void add(int x, int  v)
{
	for (int i = x; i <= N; i += lowbit(i)) {
		tree[i] += v;
	}
}

int get_sum(int x)
{
	int ans = 0;
	for (int i = x; i; i -= lowbit(i)) {
		ans += tree[i];
	}
	return ans;
}

int main()
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		cin >> arr[i];
	}
	while (m--) {
		char op[2];
		cin >> op;
		int l, r, d;
		if(op[0]=='C'){
			cin >> l >> r >> d;
			add(l, d);
			add(r + 1, -d);
		}
		else {
			cin >> l;
			cout << arr[l] + get_sum(l) << endl;
		}
	}
	return 0;
}